import request from '@/utils/request'

export function page(data) {
  return request({
    url: '/ay/page',
    method: 'post',
    data // 直接将data对象作为请求体
  })
}
export function list() {
  return request({
    url: '/ay/list',
    method: 'post'
  })
}

export function add(schoolyear) {
  return request({
    url: '/ay',
    method: 'post',
    data: schoolyear
  })
}

export function update(schoolyear) {
  return request({
    url: '/ay',
    method: 'put',
    data: schoolyear
  })
}

export function selectById(id) {
  return request({
    url: '/ay/' + id,
    method: 'get'
  })
}

export function terms() {
  return request({
    url: '/ay/terms',
    method: 'get'
  })
}

export function deleteById(id) {
  return request({
    url: '/ay/delete',
    method: 'post',
    data: { id }
  })
}
